home *** CD-ROM | disk | FTP | other *** search
/ Over 1,000 Windows 95 Programs / Over 1000 Windows 95 Programs (Microforum) (Disc 1).iso / 0361 / advsetti.frm next >
Text File  |  1997-03-31  |  11KB  |  385 lines

  1. VERSION 2.00
  2. Begin Form AdvSettings 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "Advanced Settings"
  6.    ClientHeight    =   1770
  7.    ClientLeft      =   2175
  8.    ClientTop       =   2265
  9.    ClientWidth     =   6015
  10.    ControlBox      =   0   'False
  11.    Height          =   2205
  12.    Left            =   2100
  13.    LinkTopic       =   "Form2"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   1770
  17.    ScaleWidth      =   6015
  18.    Top             =   1905
  19.    Width           =   6165
  20.    Begin CommandButton Command3 
  21.       Cancel          =   -1  'True
  22.       Caption         =   "Cancel"
  23.       Height          =   330
  24.       Left            =   2985
  25.       TabIndex        =   6
  26.       Top             =   1245
  27.       Width           =   1215
  28.    End
  29.    Begin CommandButton Command1 
  30.       Caption         =   "OK"
  31.       Default         =   -1  'True
  32.       Height          =   330
  33.       Left            =   1650
  34.       TabIndex        =   5
  35.       Top             =   1245
  36.       Width           =   1215
  37.    End
  38.    Begin PictureBox U 
  39.       AutoSize        =   -1  'True
  40.       Height          =   360
  41.       Left            =   4080
  42.       Picture         =   ADVSETTI.FRX:0000
  43.       ScaleHeight     =   330
  44.       ScaleWidth      =   135
  45.       TabIndex        =   12
  46.       TabStop         =   0   'False
  47.       Top             =   3660
  48.       Visible         =   0   'False
  49.       Width           =   165
  50.    End
  51.    Begin PictureBox D 
  52.       AutoSize        =   -1  'True
  53.       Height          =   360
  54.       Left            =   3900
  55.       Picture         =   ADVSETTI.FRX:012A
  56.       ScaleHeight     =   330
  57.       ScaleWidth      =   135
  58.       TabIndex        =   11
  59.       TabStop         =   0   'False
  60.       Top             =   3660
  61.       Visible         =   0   'False
  62.       Width           =   165
  63.    End
  64.    Begin PictureBox N 
  65.       AutoSize        =   -1  'True
  66.       Height          =   360
  67.       Left            =   4260
  68.       Picture         =   ADVSETTI.FRX:0254
  69.       ScaleHeight     =   330
  70.       ScaleWidth      =   135
  71.       TabIndex        =   10
  72.       TabStop         =   0   'False
  73.       Top             =   3660
  74.       Visible         =   0   'False
  75.       Width           =   165
  76.    End
  77.    Begin PictureBox SpinButton 
  78.       AutoSize        =   -1  'True
  79.       BackColor       =   &H00C0C0C0&
  80.       Height          =   360
  81.       Index           =   0
  82.       Left            =   2835
  83.       ScaleHeight     =   330
  84.       ScaleWidth      =   135
  85.       TabIndex        =   9
  86.       TabStop         =   0   'False
  87.       Top             =   255
  88.       Width           =   165
  89.    End
  90.    Begin SSFrame Frame3D1 
  91.       ForeColor       =   &H00000000&
  92.       Height          =   420
  93.       Index           =   0
  94.       Left            =   2430
  95.       TabIndex        =   8
  96.       Top             =   180
  97.       Width           =   345
  98.       Begin TextBox tDelay 
  99.          Alignment       =   1  'Right Justify
  100.          BackColor       =   &H00C0C0C0&
  101.          BorderStyle     =   0  'None
  102.          Height          =   216
  103.          Left            =   36
  104.          MaxLength       =   2
  105.          MultiLine       =   -1  'True
  106.          TabIndex        =   2
  107.          Tag             =   "h"
  108.          Text            =   "99"
  109.          Top             =   150
  110.          Width           =   276
  111.       End
  112.    End
  113.    Begin SSFrame Frame3D1 
  114.       ForeColor       =   &H00000000&
  115.       Height          =   420
  116.       Index           =   2
  117.       Left            =   2430
  118.       TabIndex        =   7
  119.       Top             =   630
  120.       Width           =   345
  121.       Begin TextBox tGiveaway 
  122.          Alignment       =   1  'Right Justify
  123.          BackColor       =   &H00C0C0C0&
  124.          BorderStyle     =   0  'None
  125.          Height          =   210
  126.          Left            =   30
  127.          MaxLength       =   2
  128.          MultiLine       =   -1  'True
  129.          TabIndex        =   4
  130.          Tag             =   "h"
  131.          Text            =   "99"
  132.          Top             =   150
  133.          Width           =   270
  134.       End
  135.    End
  136.    Begin PictureBox SpinButton2 
  137.       AutoSize        =   -1  'True
  138.       BackColor       =   &H00C0C0C0&
  139.       Height          =   360
  140.       Index           =   0
  141.       Left            =   2835
  142.       ScaleHeight     =   330
  143.       ScaleWidth      =   135
  144.       TabIndex        =   0
  145.       TabStop         =   0   'False
  146.       Top             =   705
  147.       Width           =   165
  148.    End
  149.    Begin Label Label2 
  150.       BackColor       =   &H00C0C0C0&
  151.       BackStyle       =   0  'Transparent
  152.       Caption         =   "times before next update check"
  153.       Height          =   240
  154.       Index           =   3
  155.       Left            =   3045
  156.       TabIndex        =   14
  157.       Top             =   780
  158.       Width           =   2775
  159.    End
  160.    Begin Label Label2 
  161.       BackColor       =   &H00C0C0C0&
  162.       BackStyle       =   0  'Transparent
  163.       Caption         =   "seconds"
  164.       Height          =   240
  165.       Index           =   0
  166.       Left            =   3045
  167.       TabIndex        =   13
  168.       Top             =   330
  169.       Width           =   1500
  170.    End
  171.    Begin Label Label2 
  172.       Alignment       =   1  'Right Justify
  173.       BackColor       =   &H00C0C0C0&
  174.       BackStyle       =   0  'Transparent
  175.       Caption         =   "Update display every"
  176.       Height          =   240
  177.       Index           =   1
  178.       Left            =   105
  179.       TabIndex        =   1
  180.       Top             =   330
  181.       Width           =   2280
  182.    End
  183.    Begin Label Label2 
  184.       Alignment       =   1  'Right Justify
  185.       BackColor       =   &H00C0C0C0&
  186.       BackStyle       =   0  'Transparent
  187.       Caption         =   "Give control to Windows"
  188.       Height          =   240
  189.       Index           =   2
  190.       Left            =   0
  191.       TabIndex        =   3
  192.       Top             =   780
  193.       Width           =   2370
  194.    End
  195. End
  196. Option Explicit
  197. Declare Function GetTickCount Lib "User" () As Long
  198. Declare Function GetAsyncKeyState Lib "User" (ByVal vKey As Integer) As Integer
  199.  
  200. Dim LastY As Single
  201. Dim LastDirection As String
  202. Dim tVal As Integer
  203.  
  204. Sub Command1_Click ()
  205. gtDelay = tDelay.Text
  206. gtGiveaway = tGiveaway.Text
  207. Unload Me
  208. End Sub
  209.  
  210. Sub Command3_Click ()
  211.    gtGiveaway = SavedtGiveaway
  212.    gtDelay = SavedtDelay
  213.    Unload Me
  214. End Sub
  215.  
  216. Sub Form_Load ()
  217. Dim InitialHeight As Integer
  218.     InitialHeight = SpinButton(0).Height
  219.     
  220.     SpinButton(0).Picture = N.Picture       'Set to the Normal Spin Button
  221.     SpinButton(0).Top = SpinButton(0).Top + (InitialHeight - SpinButton(0).Height) / 2
  222.     SpinButton2(0).Picture = N.Picture       'Set to the Normal Spin Button
  223.     SpinButton2(0).Top = SpinButton2(0).Top + (InitialHeight - SpinButton2(0).Height) / 2
  224.    AdvSettings.Left = Screen.Width / 2 - (AdvSettings.Width / 2)
  225.    AdvSettings.Top = Screen.Height / 2 - (AdvSettings.Height / 2)
  226.    tGiveaway.Text = gtGiveaway
  227.    tDelay.Text = gtDelay
  228. End Sub
  229.  
  230. Sub MoveDown (c As Control)
  231. Dim CurVal As Integer
  232. CurVal% = Val(c.Text) - 1
  233. If CurVal% > 0 Then c.Text = CurVal%
  234. End Sub
  235.  
  236. Sub MoveUp (c As Control)
  237. Dim CurVal As Integer
  238. CurVal% = Val(c.Text) + 1
  239. If CurVal% < 100 Then c.Text = CurVal%
  240. End Sub
  241.  
  242. Sub SpinButton_MouseDown (Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  243.  
  244. Const VK_LBUTTON = &H1
  245. Const TIME_DELAY = 180      ' Time delay between Spin Button Events
  246.  
  247. Dim dwEvent As Long
  248. LastY = Y
  249. ' Make sure that the Spin Button Event occurs at least once
  250. dwEvent = GetTickCount() - TIME_DELAY
  251.  
  252. SpinIt:
  253.  
  254.    ' Do this while the user holds down the left mouse button
  255.    Do While (GetAsyncKeyState(VK_LBUTTON) And &H8000) = -32768
  256.  
  257.         ' Break out of the loop if we haven't waited long enough
  258.         If dwEvent + TIME_DELAY > GetTickCount() Then GoTo Break:
  259.  
  260.         ' If the user wants to increment the counter
  261.         If Y > (SpinButton(Index).Height \ 2) Then
  262.             SpinButton(Index).Picture = d.Picture  ' Set Picture to Up
  263.             Call MoveDown(tDelay)
  264.             LastDirection$ = "d"
  265.         End If
  266.  
  267.         ' If the user wants to decrement the counter
  268.         If Y < (SpinButton(Index).Height \ 2) Then
  269.             SpinButton(Index).Picture = u.Picture   ' Set Picture to Down
  270.             Call MoveUp(tDelay)
  271.             LastDirection$ = "u"
  272.         End If
  273.  
  274.         ' Save the last time the Spin Button was active
  275.         dwEvent = GetTickCount()
  276.     Loop
  277.     
  278.     ' Set the Picture to Normal
  279.     SpinButton(Index).Picture = N.Picture
  280.     tDelay.SetFocus
  281.     DoEvents
  282.     
  283.     Exit Sub
  284.  
  285. Break:
  286.     GoTo SpinIt:
  287.  
  288.  
  289. End Sub
  290.  
  291. Sub SpinButton2_MouseDown (Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  292.  
  293. Const VK_LBUTTON = &H1
  294. Const TIME_DELAY = 180      ' Time delay between Spin Button Events
  295.  
  296. Dim dwEvent As Long
  297. LastY = Y
  298. ' Make sure that the Spin Button Event occurs at least once
  299. dwEvent = GetTickCount() - TIME_DELAY
  300.  
  301. SpinIt2:
  302.  
  303.    ' Do this while the user holds down the left mouse button
  304.    Do While (GetAsyncKeyState(VK_LBUTTON) And &H8000) = -32768
  305.  
  306.         ' Break out of the loop if we haven't waited long enough
  307.         If dwEvent + TIME_DELAY > GetTickCount() Then GoTo Break2:
  308.  
  309.         ' If the user wants to increment the counter
  310.         If Y > (SpinButton2(Index).Height \ 2) Then
  311.             SpinButton2(Index).Picture = d.Picture  ' Set Picture to Up
  312.             Call MoveDown(tGiveaway)
  313.             LastDirection$ = "d"
  314.         End If
  315.  
  316.         ' If the user wants to decrement the counter
  317.         If Y < (SpinButton2(Index).Height \ 2) Then
  318.             SpinButton2(Index).Picture = u.Picture   ' Set Picture to Down
  319.             Call MoveUp(tGiveaway)
  320.             LastDirection$ = "u"
  321.         End If
  322.  
  323.         ' Save the last time the Spin Button was active
  324.         dwEvent = GetTickCount()
  325.     Loop
  326.     
  327.     ' Set the Picture to Normal
  328.     SpinButton2(Index).Picture = N.Picture
  329.     tGiveaway.SetFocus
  330.     DoEvents
  331.     
  332.     Exit Sub
  333.  
  334. Break2:
  335.     GoTo SpinIt2:
  336.  
  337.  
  338.  
  339. End Sub
  340.  
  341. Sub tDelay_GotFocus ()
  342. tDelay.SelStart = 0
  343. tDelay.SelLength = 2
  344.  
  345. End Sub
  346.  
  347. Sub tDelay_KeyPress (KeyAscii As Integer)
  348. If KeyAscii >= 32 Then
  349.    If KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then KeyAscii = 0
  350. End If
  351.  
  352. End Sub
  353.  
  354. Sub tDelay_LostFocus ()
  355. tVal = Val(tDelay.Text)
  356. If tVal < 1 Or tVal > 99 Then
  357.    tVal = 99
  358. End If
  359. tDelay.Text = Format$(tVal, "0")
  360.  
  361. End Sub
  362.  
  363. Sub tGiveaway_GotFocus ()
  364. tGiveaway.SelStart = 0
  365. tGiveaway.SelLength = 2
  366.  
  367. End Sub
  368.  
  369. Sub tGiveaway_KeyPress (KeyAscii As Integer)
  370. If KeyAscii >= 32 Then
  371.    If KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then KeyAscii = 0
  372. End If
  373.  
  374. End Sub
  375.  
  376. Sub tGiveaway_LostFocus ()
  377. tVal = Val(tGiveaway.Text)
  378. If tVal < 1 Or tVal > 99 Then
  379.    tVal = 99
  380. End If
  381. tGiveaway.Text = Format$(tVal, "0")
  382.  
  383. End Sub
  384.  
  385.